<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>流程发布</title>
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" th:href="@{/resources/bootstrap/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/resources/awi/css/font-awesome.min.css}">
    <!--File input -->
    <link rel="stylesheet" th:href="@{/resources/plugins/bootstrap-fileinput/css/fileinput.min.css}">


</head>
<body>
   <div class="container">
        <div class="row">
            <div class="col-md-offset-1 col-md-10">
                <h3>流程发布</h3>
                <hr>
            </div>
        </div>
       <div class="row">
           <div class="col-md-10 col-md-offset-1">
               <form role="form">
                   <div class="form-group">
                       <label for="bpmnFile">文件选择</label>
                       <input type="file" class="fileinput" id="bpmnFile" name="bpmnFile">
                   </div>
                   <hr>
                   <div class="form-group">
                       <button type="button" class="btn btn-primary center-block" onclick="deploy()"><i class="fa fa-save"></i>&nbsp;发布</button>
                   </div>
               </form>
           </div>

       </div>
   </div>
</body>
<!-- jQuery 2.2.3 -->
<script th:src="@{/resources/plugins/jQuery/jquery-2.2.3.min.js}"></script>
<!-- Bootstrap 3.3.6 -->
<script th:src="@{/resources/bootstrap/js/bootstrap.min.js}"></script>
<!--文件上传控件 -->
<script th:src="@{/resources/plugins/bootstrap-fileinput/js/fileinput.min.js}"></script>
<script th:src="@{/resources/plugins/bootstrap-fileinput/js/fileinput_locale_zh.js}"></script>

<script type="text/javascript">
    $(function () {
        var fileinput = $(".fileinput").fileinput({
            language: 'zh',
            uploadUrl: '/processSetting/deploy',
            uploadAsync: true, //默认异步上传
            showUpload: false, //是否显示上传按钮
            showRemove: false, //显示移除按钮
            showPreview: false, //是否显示预览
            showCaption: true,//是否显示标题
            browseClass: "btn btn-info", //按钮样式
            dropZoneEnabled: false,//是否显示拖拽区域
        });
    })
    function deploy() {
        $('#bpmnFile').fileinput('upload');

    }
</script>

</html>